package entity;
import java.util.regex.*;
public class AmExCC extends CreditCard{
    @Override
    public boolean isValid(String number) {
        super.isValid(number);

        String regex = "3[47]\\d{13}";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(number);
        return matcher.matches();
    }

    @Override
    public String getIssuer() {
        return "American Express";
    }

    @Override
    public AmExCC getInstance(){
        return new AmExCC();
    }
}
